package com;

import org.omg.CORBA.INTERNAL;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 排序接口
 */
public class ComparatorOne {
    public static List<Integer> lowToHieght(List<Integer> list){
            list.sort((x1,x2)->{
                return x1-x2;
            });

            return list;

    }
    public  static List<Integer> heightToLow(List<Integer> list){
        list.sort((x1,x2)->{
            return x2-x1;
        });
        return list;
    }
    public static List<Integer> dengyu(List<Integer> list){
        list.sort((x1,x2)->{
            return x1=x2;
        });

        return list;
    }


    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(new Integer[]{1,23,12,123,54,668,12,43,66,987});
        System.out.println(list);
        System.out.println(lowToHieght(list));
        System.out.println(heightToLow(list));
        System.out.println(dengyu(list));
    }
}
